<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>CSC560 Design and Analysis of Real-Time Systems</title>
<meta name="keywords" content="CSC560" />
<meta name="description" content="CSC560" />
<link href="../default.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
	<div id="header">
		<h1>CSC560</h1>
		<h2>Design and Analysis of Real-Time Systems</h2>
		<ul>
			<li class="first"> <a href="../index.html" accesskey="1" title="">Home</a> </li>
			<li> <a href="../project1/index.html" accesskey="2" title="">Project 1</a>	</li>
			<li> <a href="../project2/index.html" accesskey="3" title="">Project 2</a> </li>
			<li> <a href="index.html" accesskey="4" title=""><b>Project 3</b></a> </li>
			<li> <a href="../project4/index.html" accesskey="4" title="">Project 4</a> </li>
			<li> <a href="../project5/index.html" accesskey="4" title="">Project 5</a> </li>
		</ul>
	</div>
</div>
<div id="content">
	<div id="colOne">
		<h2>Test Cases</h2>
		<p>
			This section first describes a summary of the test cases executed.
			Then, we discuss some of the most important test cases for BRR and timed mutexes.
			We have followed the approach shown in previous student projects in terms of testing. 
			We have used a trace array to follow the order of execution of tasks in our RTOS.
			Therefore, the trace collects information about which task is running at which time, 
			and at after the trace arrays reach its record limit, it prints to uart.
			This approach ensures that no data is printed while RTOS is busy executing, and 
			helps to avoid timing errors.
		</p>
		<h3>BRR Test Cases Summary</h3>
		<p>
			<ul>
				<li> 1. <i>test000.c: </i> Test to verify trace is working properly.
				</li>
				<li> 2. <i>test001.c: </i> Test one BRR task only.
				</li>
				<li> 3. <i>test002.c: </i> Test to verify that BRR is scheduled after periodic.
				</li>
				<li> 4. <i>test003.c: </i> Test to verify BRR is never scheduled after periodic.
				</li>
				<li> 5. <i>test004.c: </i> Testing BRR task with 0 quantum.
				</li>
				<li> 6. <i>test005.c: </i> Test to verify BRR with quantum 0 is scheduled after periodic.
				</li>
				<li> 7. <i>test006.c: </i> Test one system and one BRR with quantum 0.
				</li>
				<li> 8. <i>test007.c: </i> Test one periodic and two BRR with quantum 0.
				</li>
				<li> 9. <i>test008.c: </i> Test one system and one BRR with quantum not equal to 0
				</li>
				<li> 10. <i>test009.c: </i> Test mixture of system, periodic, and BRR
				</li>
			</ul>
		</p>
		<h3>Timed Mutex Test Cases Summary</h3>
		<p>
			<ul>
				<li> 1. <i>test000.c: </i> Test to verify trace is working properly.
				</li>
				<li> 2. <i>test001.c: </i> Test two BRR tasks on basic locking/unlocking a mutex.
				</li>
				<li> 3. <i>test002.c:</i> Test two system tasks on basic locking/unlocking a mutex.
				</li>
				<li> 4. <i>test003.c:</i> Test two BRR tasks without mutex to contrast with test004.c.
				</li>
				<li> 5. <i>test004.c:</i> Test two BRR tasks with mutex to contrast with test003.c
				</li>
				<li> 6. <i>test005.c:</i> Test a SYSTEM task preempting a BRR
				</li>
				<li> 7. <i>test006.c:</i> Test MUTEX promotion to SYSTEM level for BRR
				</li>
				<li> 8. <i>test007.c:</i> Test recursive locks on the same mutex
				</li>
				<li> 9. <i>test008.c:</i> Test locks on different mutexes by the same task and the BRR should be restored to its original level.
				</li>
				<li> 10. <i>test009.c:</i> Testing active check on mutex timing violation.
				</li>
				<li> 11. <i>test010.c</i> Test barging
				</li>
			</ul>
		</p>
		
		<h3>BRR Test Cases Discussion</h3>
		<p>
			The most important test cases for BRR were the ones that deal with selecting a particular BRR task that can fit the next IDLE time.
			We created 4 test cases to ensure covering all different cases. For instance, we built 2 test cases that verifies the interaction
			between a periodic and a BRR task. The first test case, test002.c, creates a periodic task that runs every 2 ticks and a BRR task
			that runs every tick. Since the periodic task finishes executing before the end of its period, some time is left for the BRR task to
			execute. Therefore, we expected to see 1000...1000 which shows that the periodic task goes first, and that the BRR task executes next.
			By varying the length of the period, we created another test case to verify that a BRR task is never scheduled in between the time 
			a periodic task finishes and before the next periodic task begins. Thus, the second test case implemented creates a periodic task that
			runs every tick, leaving the BRR task run for 1 tick. This has for effect to remove any possibility for the BRR task to run. The two other
			test cases dealt with creating IDLE periodic task, so that a BRR with a quantum to small to run during the elapsed time before the next periodic
			task runs, but large enough to run if we add the time the IDLE task can run for. 
			
			
		</p>
		
		<h3>Timed Mutex Test Cases</h3>
		<p>
			As elaborated in the 'Challenge' section of Timed Mutex, a number of key points, such as barging, priority inversion, 
			and nest locking/unlocking are of particular interest and are tested with specific test cases listed above.
		</p>
		
	</div>
	<div id="colTwo">
		<h3>Project Sections</h3>
		<ul>
			<li class="first"><a href="part1_brr.html">Bounded Round Robin</a></li>
			<li><a href="part2_mutex.html">Timed Mutex</a></li>
			<li><a href="part3_test_cases.html"><b>Test Cases</b></a></li>
			<li><a href="part4_logic_analyzer.html">Logic Analyzer</a></li>
			<li><a href="doxygen/html/index.html">Doxygen</a></li>
			<li><a href="http://code.google.com/p/wireless-roomba">Google Code</a></li>
		</ul>
	</div>
</div>
<div id="footer">
	<p>
		@ 2009. All Rights Reserved. Design by 
		<a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.
	</p>
</div>
</body>
</html>
